package com.tfh.strategy;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class DayFactory extends Factory {
    public DayFactory(){}

    @Override
    public List<BigDecimal> calc(BigDecimal water) {
        final List<Integer> month = Arrays.asList(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
        BigDecimal mean = water.divide(BigDecimal.valueOf(365), RoundingMode.HALF_UP);
        return month.stream().map((Integer day)-> mean.multiply(BigDecimal.valueOf(day))).collect(Collectors.toList());
    }
}
